import { createBrowserRouter, Navigate } from "react-router-dom";
import App from "../App";
import Home from "../views/home/home"
import Login from "../views/login/login"
import Shopcar from "../views/shopcar/shopcar";
import Zuce from "../views/zuce/zuce";
// 创建路由对象并导出
    const router = createBrowserRouter([
        {
            path: "/",
            element: <App />,
            children: [ // 子路由
                {
                    path: "/",
                    // 路由重定向, 借助Navigate组件跳转
                    element: <Navigate to="/home" replace />,
                },
                {
                    path: "/home",
                    element: <Home/>,
                },
                {
                    path: "/login",
                    element: <Login />,
                },
                {
                    path: "/zuce",
                    element: <Zuce />,
                },
                {
                    path: "/shopcar",
                    element: <Shopcar />,
                }
            ],

        },
    ]);
    export default router;